MIDI Component Functions
This section describes the functions that are implemented by MIDI components.
These functions implemented by MIDI components are MIDI device drivers, and are called by the note allocator MIDI routines.
NAGetMIDIPorts
is the correct call for users to make. Users should not call
QTMIDI
.
QTMIDIGetMIDIPorts
You use the QTMIDIGetMIDIPorts function to get two lists of MIDI ports supported by the specified MIDI component: a list of ports that can receive MIDI input and a list of ports that can send MIDI output.
pascal ComponentResult QTMIDIGetMIDIPorts (
QTMIDIComponent ci,
QTMIDIPortListHandle *inputPorts,
QTMIDIPortListHandle *outputPorts);
-
ci
-
Specifies the instance of a MIDI component. Your software obtains this reference when calling the Component Manager's
OpenComponent
or
OpenDefaultComponent
function.
-
inputPorts
-
A list of the MIDI ports supported by the component that can receive MIDI input.
-
outputPorts
-
A list of the MIDI ports supported by the component that can send MIDI output.
DISCUSSION
The caller of this function must dispose of the inputPorts and outputPorts handles.
RESULT CODES
To be provided.
QTMIDISendMIDI
You use the QTMIDISendMIDI function to send MIDI data to a MIDI port.
pascal ComponentResult QTMIDISendMIDI (
QTMIDIComponent ci,
long portIndex,
MusicMIDIPacket *mp);
-
ci
-
Specifies the instance of a MIDI component. Your software obtains this reference when calling the Component Manager's
OpenComponent
or
OpenDefaultComponent
function.
-
portIndex
-
The index of the MIDI port to use for this operation.
-
mp
-
A pointer to the MIDI data packet to send.
DISCUSSION
The QTMIDISendMIDI function can be called at interrupt time. However, the same interrupt level is used whenever MIDI data is sent by a the specified MIDI component.
RESULT CODES
To be provided.
QTMIDIUseReceivePort
You use the QTMIDIUseReceivePort function to allocate a MIDI port for input or to release the port.
pascal ComponentResult QTMIDIUseReceivePort (
QTMIDIComponent ci,
long portIndex,
MusicMIDIReadHookUPP readHook,
long refCon);
-
ci
-
Specifies the instance of a MIDI component. Your software obtains this reference when calling the Component Manager's
OpenComponent
or
OpenDefaultComponent
function.
-
portIndex
-
The index of the MIDI port to use for this operation.
-
readHook
-
A pointer to a function in your software that receives incoming MIDI data packets, or
nil
to release the port.
-
refCon
-
A reference constant passed to the
readHook
.
DISCUSSION
The MIDI component delivers only MIDI data packets that contain only a single status byte.
RESULT CODES
To be provided.
QTMIDIUseSendPort
You use the QTMIDIUseSendPort function to allocate a MIDI port for output or to release the port.
pascal ComponentResult QTMIDIUseSendPort (
QTMIDIComponent ci,
long portIndex,
long inUse);
-
ci
-
Specifies the instance of a MIDI component. Your software obtains this reference when calling the Component Manager's
OpenComponent
or
OpenDefaultComponent
function.
-
portIndex
-
The index of the MIDI port for this operation.
-
inUse
-
Specifies whether to allocate the MIDI port for output (if the value is
1
) or to release the port (if the value is
0
).
RESULT CODES
To be provided.
© 1997 Apple Computer, Inc.Previous | Chapter Top | Chapter Contents | Next